<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>1.跨域问题_限制DOM访问</title>
</head>
<body>
    <h2>君不见黄河之水天上来</h2>
    <button onclick="showDOM()">获取页面2的DOM</button>

    <!-- <iframe id="framePage" src="http://127.0.0.1:5500/demo.html" frameborder="1"></iframe> -->
    <iframe id="framePage" src="https://www.baidu.com" frameborder="1"></iframe>

    <script type="text/javascript">
        function showDOM(){
            const framePage = document.getElementById('framePage')
            console.log(framePage.contentWindow.document.body);
        }
    </script>
</body>
</html>